
a = "aAsmr3idd4bgs7Dls9eAF"
m1 =''.join([x for x in a if x.isdigit()])
print('a字符串中的数字：', m1)
m2 = a[::-1]
print('将a字符串倒序：', m2)
m3 = a[9] + '_'+ a[10]+'_' + a[11]+'_'+a[12]+'_'+a[13]
print('由部分字符串a与下划线拼接：', m3)

count = 0
for i in a.lower():
    if i == 'a':
        count +=1
print(r'字符串a中‘a’出现的次数：', count)

b = "ABCDabcd"
for i in a:
    if i in b:
        a = a.replace(i, '')
print(r'删除字符串‘b’中所有字符：', a)


